﻿/*
 * Author: Mattan360
 * Contributors: VillageIdiot
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Irrlicht.Net.Video;

namespace Irrlicht.Net
{
    public static class DriverChoice
    {
        public static DriverTypes FromConsole()
        {
            // ask user for driver
            DriverTypes driverType;

            Console.WriteLine("Please select the driver you want for this example:\n" +
                " (a) OpenGL 1.5\n (b) Direct3D 9.0c\n (c) Direct3D 8.1\n" +
                " (d) Burning's Software Renderer\n (e) Software Renderer\n" +
                " (f) NullDevice\n (otherKey) exit\n\n");

            ConsoleKeyInfo keyInfo;
            keyInfo = Console.ReadKey();

            switch (keyInfo.KeyChar)
            {
                case 'a':
                    {
                        driverType = DriverTypes.OpenGL;
                        break;
                    }
                case 'b':
                    {
                        driverType = DriverTypes.Direct3D9;
                        break;
                    }
                case 'c':
                    {
                        driverType = DriverTypes.Direct3D8;
                        break;
                    }
                case 'd':
                    {
                        driverType = DriverTypes.BurningsVideo;
                        break;
                    }
                case 'e':
                    {
                        driverType = DriverTypes.Software;
                        break;
                    }
                case 'f':
                    {
                        driverType = DriverTypes.Null;
                        break;
                    }
                default:
                    {
                        driverType = DriverTypes.Count;
                        break;
                    }
            }

            return driverType;
        }
    }
}
